/**
 * @file:          motor_drv42_v12.h
 * @brief:         
 * @details:       
 * @author:        wjh
 * @date created:  2023.10.25
 * @version:       1.0.0
 * @par copyright (c):
 *   
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.08.14,11:14:31
 */


#ifndef _MOTOR_DRV42_V12_H_
#define _MOTOR_DRV42_V12_H_

/* Include Files **************************************************************/
#include "Datatype.h"
#include "ch32v30x_module.h"
#include "motor_drv42.h"

/* Macro Definition ***********************************************************/

/* Data Type Define ***********************************************************/
    
/* Variable Declare ***********************************************************/

/* Function Declare ***********************************************************/
uint8 Motor_drv42_v12_Init(struct Motor_drv42 *self);
void Motor_drv42_v12_LedToggle(struct Motor_drv42 *self);
uint8 Motor_drv42_v12_AdcCalibration(struct Motor_drv42 *self);
float32 Motor_drv42_v12_Adc2Current(struct Motor_drv42 *self, int16 adc_val);
float32 Motor_drv42_v12_GetIaFdb(struct Motor_drv42 *self);
float32 Motor_drv42_v12_GetIbFdb(struct Motor_drv42 *self);
void Motor_drv42_v12_UpdatePWM(struct Motor_drv42 *self);
void Motor_drv42_v12_TestGpio_Set(struct Motor_drv42 *self);
void Motor_drv42_v12_TestGpio_Reset(struct Motor_drv42 *self);
float Motor_drv42_v12_GetPowerVoltage(struct Motor_drv42 *self);
float Motor_drv42_v12_GetMcuTemperature(struct Motor_drv42 *self);

#endif